package com.zjw.config;

import com.zjw.interceptor.CorsInterceptor;
import com.zjw.interceptor.LicenseInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * 默认SpringMVC拦截器
 *
 * @author zjw
 * @date 2021/02/21
 */
@Configuration
public class DefaultWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CorsInterceptor()).addPathPatterns("/**");
        registry.addInterceptor(new LicenseInterceptor()).addPathPatterns("/**");
    }
}
